pub const BASS_ERROR_MEM: i32           = 1;   // memory error
pub const BASS_ERROR_FILEOPEN: i32      = 2;   // can't open the file
pub const BASS_ERROR_DRIVER: i32        = 3;   // can't find a free/valid driver
pub const BASS_ERROR_BUFLOST: i32       = 4;   // the sample buffer was lost
pub const BASS_ERROR_HANDLE: i32        = 5;   // invalid handle
pub const BASS_ERROR_FORMAT: i32        = 6;   // unsupported sample format
pub const BASS_ERROR_POSITION: i32      = 7;   // invalid position
pub const BASS_ERROR_INIT: i32          = 8;   // BASS_Init has not been successfully called
pub const BASS_ERROR_START: i32         = 9;   // BASS_Start has not been successfully called
pub const BASS_ERROR_SSL: i32           = 10;  // SSL/HTTPS support isn't available
pub const BASS_ERROR_REINIT: i32        = 11;  // device needs to be reinitialized
pub const BASS_ERROR_ALREADY: i32       = 14;  // already initialized/paused/whatever
pub const BASS_ERROR_NOTAUDIO: i32      = 17;  // file does not contain audio
pub const BASS_ERROR_NOCHAN: i32        = 18;  // can't get a free channel
pub const BASS_ERROR_ILLTYPE: i32       = 19;  // an illegal type was specified
pub const BASS_ERROR_ILLPARAM: i32      = 20;  // an illegal parameter was specified
pub const BASS_ERROR_NO3D: i32          = 21;  // no 3D support
pub const BASS_ERROR_NOEAX: i32         = 22;  // no EAX support
pub const BASS_ERROR_DEVICE: i32        = 23;  // illegal device number
pub const BASS_ERROR_NOPLAY: i32        = 24;  // not playing
pub const BASS_ERROR_FREQ: i32          = 25;  // illegal sample rate
pub const BASS_ERROR_NOTFILE: i32       = 27;  // the stream is not a file stream
pub const BASS_ERROR_NOHW: i32          = 29;  // no hardware voices available
pub const BASS_ERROR_EMPTY: i32         = 31;  // the file has no sample data
pub const BASS_ERROR_NONET: i32         = 32;  // no internet connection could be opened
pub const BASS_ERROR_CREATE: i32        = 33;  // couldn't create the file
pub const BASS_ERROR_NOFX: i32          = 34;  // effects are not available
pub const BASS_ERROR_NOTAVAIL: i32      = 37;  // requested data/action is not available
pub const BASS_ERROR_DECODE: i32        = 38;  // the channel is/isn't a "decoding channel"
pub const BASS_ERROR_DX: i32            = 39;  // a sufficient DirectX version is not installed
pub const BASS_ERROR_TIMEOUT: i32       = 40;  // connection timed out
pub const BASS_ERROR_FILEFORM: i32      = 41;  // unsupported file format
pub const BASS_ERROR_SPEAKER: i32       = 42;  // unavailable speaker
pub const BASS_ERROR_VERSION: i32       = 43;  // invalid BASS version (used by add-ons)
pub const BASS_ERROR_CODEC: i32         = 44;  // codec is not available/supported
pub const BASS_ERROR_ENDED: i32         = 45;  // the channel/file has ended
pub const BASS_ERROR_BUSY: i32          = 46;  // the device is busy
pub const BASS_ERROR_UNSTREAMABLE: i32  = 47;  // unstreamable file
pub const BASS_ERROR_PROTOCOL: i32      = 48;  // unsupported protocol
pub const BASS_ERROR_DENIED: i32        = 49;  // access denied
pub const BASS_ERROR_UNKNOWN: i32       = -1;  // some other mystery problem


pub(crate) fn get_err_info(err_code: i32) -> Option<String> {
    match err_code {
        BASS_ERROR_MEM          => Some(format!("BASS_ERROR_MEM<memory error>           | ERR_CODE<{}>", err_code)),
        BASS_ERROR_FILEOPEN     => Some(format!("BASS_ERROR_FILEOPEN<can't open the file> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_DRIVER       => Some(format!("BASS_ERROR_DRIVER<can't find a free/valid driver> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_BUFLOST      => Some(format!("BASS_ERROR_BUFLOST<the sample buffer was lost> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_HANDLE       => Some(format!("BASS_ERROR_HANDLE<invalid handle>       | ERR_CODE<{}>", err_code)),
        BASS_ERROR_FORMAT       => Some(format!("BASS_ERROR_FORMAT<unsupported sample format> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_POSITION     => Some(format!("BASS_ERROR_POSITION<invalid position>   | ERR_CODE<{}>", err_code)),
        BASS_ERROR_INIT         => Some(format!("BASS_ERROR_INIT<BASS_Init has not been successfully called> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_START        => Some(format!("BASS_ERROR_START<BASS_Start has not been successfully called> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_SSL          => Some(format!("BASS_ERROR_SSL<SSL/HTTPS support isn't available> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_REINIT       => Some(format!("BASS_ERROR_REINIT<device needs to be reinitialized> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_ALREADY      => Some(format!("BASS_ERROR_ALREADY<already initialized/paused/whatever> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_NOTAUDIO     => Some(format!("BASS_ERROR_NOTAUDIO<file does not contain audio> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_NOCHAN       => Some(format!("BASS_ERROR_NOCHAN<can't get a free channel> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_ILLTYPE      => Some(format!("BASS_ERROR_ILLTYPE<an illegal type was specified> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_ILLPARAM     => Some(format!("BASS_ERROR_ILLPARAM<an illegal parameter was specified> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_NO3D         => Some(format!("BASS_ERROR_NO3D<no 3D support>           | ERR_CODE<{}>", err_code)),
        BASS_ERROR_NOEAX        => Some(format!("BASS_ERROR_NOEAX<no EAX support>         | ERR_CODE<{}>", err_code)),
        BASS_ERROR_DEVICE       => Some(format!("BASS_ERROR_DEVICE<illegal device number>| ERR_CODE<{}>", err_code)),
        BASS_ERROR_NOPLAY       => Some(format!("BASS_ERROR_NOPLAY<not playing>           | ERR_CODE<{}>", err_code)),
        BASS_ERROR_FREQ         => Some(format!("BASS_ERROR_FREQ<illegal sample rate>     | ERR_CODE<{}>", err_code)),
        BASS_ERROR_NOTFILE      => Some(format!("BASS_ERROR_NOTFILE<the stream is not a file stream> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_NOHW         => Some(format!("BASS_ERROR_NOHW<no hardware voices available> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_EMPTY        => Some(format!("BASS_ERROR_EMPTY<the file has no sample data> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_NONET        => Some(format!("BASS_ERROR_NONET<no internet connection could be opened> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_CREATE       => Some(format!("BASS_ERROR_CREATE<couldn't create the file> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_NOFX         => Some(format!("BASS_ERROR_NOFX<effects are not available> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_NOTAVAIL     => Some(format!("BASS_ERROR_NOTAVAIL<requested data/action is not available> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_DECODE       => Some(format!("BASS_ERROR_DECODE<the channel is/isn't a \"decoding channel\"> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_DX           => Some(format!("BASS_ERROR_DX<a sufficient DirectX version is not installed> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_TIMEOUT      => Some(format!("BASS_ERROR_TIMEOUT<connection timed out> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_FILEFORM     => Some(format!("BASS_ERROR_FILEFORM<unsupported file format> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_SPEAKER      => Some(format!("BASS_ERROR_SPEAKER<unavailable speaker> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_VERSION      => Some(format!("BASS_ERROR_VERSION<invalid BASS version (used by add-ons)> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_CODEC        => Some(format!("BASS_ERROR_CODEC<codec is not available/supported> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_ENDED        => Some(format!("BASS_ERROR_ENDED<the channel/file has ended> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_BUSY         => Some(format!("BASS_ERROR_BUSY<the device is busy> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_UNSTREAMABLE => Some(format!("BASS_ERROR_UNSTREAMABLE<unstreamable file> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_PROTOCOL     => Some(format!("BASS_ERROR_PROTOCOL<unsupported protocol> | ERR_CODE<{}>", err_code)),
        BASS_ERROR_DENIED       => Some(format!("BASS_ERROR_DENIED<access denied>       | ERR_CODE<{}>", err_code)),
        BASS_ERROR_UNKNOWN      => Some(format!("BASS_ERROR_UNKNOWN<some other mystery problem> | ERR_CODE<{}>", err_code)),
        _                       => None,
    }
}

